-
-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow failures of indirect dependencies during parallel precompillation #2021
Allow failures of indirect dependencies during parallel precompillation #2021
Conversation
As a means to not block failures by packages that weren't going to be loaded anyway, sub-dependenncy compilation failures only warn now (main deps still fail). Idea from @tkf here #2018 (comment) Note that in this case, ColorTypes is a non-deved package that I hacked an error into
|
Requires JuliaLang/julia#37596 |
Quoting the time-complexity consideration I commented in JuliaLang/julia#37596 (comment)
|
Do we think this and the julia PR is good as it stands? |
906f46e
to
e227bc2
Compare
src/API.jl
Outdated
# stdlibs that aren't loaded might need precompiling if not part of sysimage | ||
function is_stdlib_and_loaded(pkg::Base.PkgId) | ||
return Pkg.Operations.is_stdlib(pkg.uuid) && Base.root_module_exists(pkg) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref #2018 (comment)
Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com>
Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com>
Now also requires JuliaLang/julia#37652 for |
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
That CI failure seems to be a connection glitch https://travis-ci.com/github/JuliaLang/Pkg.jl/jobs/389278321#L419 |
Passed now. Just the docs that auto-cancelled with the first fail |
Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com>
Some optimizations have been added to A no-op, now looks like this, where there are 215 deps in the manifest:
|
I think this is good to go now, along with #2033 to allow opting-in to make it automatic after the common pkg calls |
any_dep_recompiled = any(map(dep_uuid->was_recompiled[dep_uuid], pkg_dep_uuid_lists[i])) | ||
if !errored && (any_dep_recompiled || is_stale(paths, sourcepath)) | ||
any_dep_recompiled = any(map(dep->was_recompiled[dep], deps)) | ||
if !errored && (any_dep_recompiled || _is_stale(paths, sourcepath, toml_c)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to rely on Base.TOMLCache
to be "async
-safe" (which is, BTW, pretty easy to break; e.g., a @debug
can ruin this property), I don't think it's necessary to move _is_stale
out. It's actually where closure is useful. Although there is nothing bad in factoring out _is_stale
this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@staticfloat did some probing of the list of toml files that were accessed when no tomlcaches were provided, and it was just the current environment manifest and project files (2 files), so the thinking was that it was async safe as it's read-only after the first use in the for-loop. Would that be broken by @debug
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be good to resolve this, and merge, to fix #2035
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
parsed_toml(cache::TOMLCache, project_file::String)
reuses TOML.Parser
: https://github.com/JuliaLang/julia/blob/2a36f83ce9bdfd17c572472f60b830aedcf181f0/base/loading.jl#L174-L175
So, for example, TOML.parse(::TOML.Parser)
has to be async-safe. It probably is and likely be so forever but relying on "likely" is not the best approach especially in concurrent programming. For example, maybe somebody will implement TOML.parse(::IO)
at some point and the parsing can happen in a streaming fashion.
(It's also a bit concerning that the I/O read(project_file, String)
is happening in get!
but that's probably handled by the .age
field in Dict
.)
Anyway, I don't think my comment should block this PR. We can fix it in Base
if we want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, merging this as-is seems like the thing to do for now
Co-authored-by: Takafumi Arakaki <takafumi.a@gmail.com>
Edit: The mechanism below has now been removed from this PR, given a better approach of allowing failures for indirect dependencies
Builds on #2018 to add the option to revert to the old-style
Pkg.precompile()
behavior if the user just wants/needs to precompile dependencies that are loaded.